home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / socket / miami3 / install_miami < prev    next >
Text File  |  1998-05-24  |  15KB  |  534 lines

  1. ; $VER: Install_Miami 3.0a (06.03.98)
  2. (procedure P-check-system-version
  3.  (if (< (/ @installer-version 65536) 43)
  4.   (abort "The Miami installation script needs Installer\n"
  5.    "version 43 or higher. It is available from Aminet\n"
  6.    "and from www.nordicglobal.com")
  7.  )
  8.  (set #exec-version (/ (getversion) 65536))
  9.  (if (< #exec-version 37)
  10.   (abort "Miami needs Kickstart 2.04 or higher.\n")
  11.  )
  12.  (if (< #exec-version 39)
  13.   (set #ag-browser "AmigaGuide")
  14.   (set #ag-browser "MultiView")
  15.  )
  16. )
  17.  
  18. (procedure P-select-destination-directory
  19.  (if (exists "Miami:" (noreq))
  20.   (
  21.    (set #old-miami-assign 1)
  22.    (set #old-miami-assign-location (expandpath "Miami:"))
  23.    (set @default-dest
  24.     (askdir
  25.      (prompt "Select the directory where you want to "
  26.       "install Miami 3.0. You already have a 'Miami:' "
  27.       "assign on your system, so it is assumed that this "
  28.       "is the location of an older version of Miami that "
  29.       "you want to upgrade.")
  30.      (help "Select the directory where you want to "
  31.       "install Miami 3.0. Since you already have a 'Miami:' "
  32.       "assign on your system you should probably accept "
  33.       "the default.")
  34.      (default "Miami:")
  35.     )
  36.    )
  37.   ) (
  38.    (set #old-miami-assign 0)
  39.    (if (exists "Work:" (noreq))
  40.     (set @default-dest "Work:")
  41.     (set @default-dest "SYS:")
  42.    )
  43.    (set @default-dest
  44.     (askdir
  45.      (prompt "Select the directory where you want to "
  46.       "install Miami 3.1. An additional directory "
  47.       "will *NOT* be created at the location you specify.")
  48.      (help "Select the directory where you want to "
  49.       "install Miami 3.0. All necessary files will be copied "
  50.       "to that directory during installation. A new directory "
  51.       "will *NOT* be created at the location you specify. "
  52.       "This means if you want Miami to be installed in its "
  53.       "own directory then you need to create that directory "
  54.       "yourself first.")
  55.      (default @default-dest)
  56.     )
  57.    )
  58.   )
  59.  )
  60.  (makeassign "Miami" @default-dest)
  61. )
  62.  
  63. (procedure P-select-binary
  64.  (set #cpu-choice (if (patmatch "68000|68010" (database "cpu")) 0 1))
  65.  (set #cpu-choice
  66.   (askchoice
  67.    (prompt "Please select which version of\nMiami you want to use:")
  68.    (help "Miami exists in a 68000 version,\n and a 68020 version.\n"
  69.     "One of these versions will be installed.")
  70.    (choices "68000/010 version" "68020/030/040/060 version")
  71.    (default #cpu-choice)
  72.   )
  73.  )
  74. )
  75.  
  76. (procedure P-check-binary
  77.  (set #bin-choice
  78.   (select #cpu-choice
  79.    "000/Miami.000"
  80.    "020/Miami.020"
  81.   )
  82.  )
  83.  (if (not (exists (tackon #source-dir #bin-choice)))
  84.   (abort "Before you can install Miami you first need to\n"
  85.    "download and unpack the archive that contains the Miami\n"
  86.    "binary you want to install.")
  87.  )
  88. )
  89.  
  90. (procedure P-select-guis
  91.  (set #gui-options
  92.   (askoptions
  93.    (prompt "Please select which GUI modules you want to use with Miami. The "
  94.     "MUI and MUIMWB modules need MUI 3.8 or higher, which has to be installed "
  95.     "BEFORE installing Miami.")
  96.    (help "Miami supports several different user interface engines: "
  97.     "MUI, MUIMWB (a version of the MUI module with additional images, "
  98.     "for screens with 8 or more colors), and GTLayout "
  99.     "(using gtlayout.library, creating GadTools gadgets). Please select "
  100.     "which ones you want to install.")
  101.    (choices "MUI" "MUIMWB (MUI with MagicWB-style images)" "GTLayout")
  102.   )
  103.  )
  104.  (if (= #gui-options 0)
  105.   (abort "You need to install at least one GUI module.")
  106.  )
  107.  (if (not (= 0 (BITAND #gui-options 3))) (
  108.   (if (not (exists "MUI:Libs/muimaster.library" (noreq)))
  109.    (abort "You need to install MUI 3.8 before you can install GUI "
  110.     "modules for Miami.")
  111.   )
  112.   (if (< (/ (getversion "MUI:Libs/muimaster.library") 65536) 18)
  113.    (abort "Your installed MUI version is too old for Miami 3.0. "
  114.     "Please upgrade to MUI 3.8 or higher before installing Miami."
  115.    )
  116.   )
  117.  ))
  118. )
  119.  
  120. (procedure P-check-gui
  121.  (if (not (exists (tackon #source-dir #current-gui)))
  122.   (abort "Before you can install Miami you first need to\n"
  123.    "download and unpack the archives that contain the Miami\n"
  124.    "GUI modules you want to install.")
  125.  )
  126. )
  127.  
  128. (procedure P-check-guis
  129.  (if (= 1 (BITAND #gui-options 1)) (
  130.   (set #current-gui "MUI")
  131.   (P-check-gui)
  132.  ))
  133.  (if (= 2 (BITAND #gui-options 2)) (
  134.   (set #current-gui "MUI")
  135.   (P-check-gui)
  136.  ))
  137.  (if (= 4 (BITAND #gui-options 4)) (
  138.   (set #current-gui "GTLayout")
  139.   (P-check-gui)
  140.  ))
  141. )
  142.  
  143.  
  144. (procedure P-select-gui
  145.  (if (= 4 (BITAND #gui-options 4))
  146.   ((set #gui-choice-gtlayout "GTLayout") (set #gui-choice 2))
  147.   (set #gui-choice-gtlayout "")
  148.  )
  149.  (if (= 1 (BITAND #gui-options 1))
  150.   ((set #gui-choice-mui "MUI") (set #gui-choice 0))
  151.   (set #gui-choice-mui "")
  152.  )
  153.  (if (= 2 (BITAND #gui-options 2))
  154.   ((set #gui-choice-muimwb "MUIMWB") (set #gui-choice 1))
  155.   (set #gui-choice-muimwb "")
  156.  )
  157.  (set #gui-choice
  158.   (askchoice
  159.    (prompt "Please select which GUI module you want to use as the default "
  160.     "module for Miami")
  161.    (help "Miami supports several different user interface engines: "
  162.     "MUI, MUIMWB (a version of the MUI module with additional images, "
  163.     "for screens with 8 or more colors), and GTLayout "
  164.     "(using gtlayout.library, creating GadTools gadgets). Please select "
  165.     "which one you want to use as the default. Only modules that you "
  166.     "selected for installation earlier can be used. Note: If you have already "
  167.     "saved the settings with a Miami version 2.9 or higher then the GUI module "
  168.     "you seleted in Miami overrides the choice you make here.")
  169.    (choices #gui-choice-mui #gui-choice-muimwb #gui-choice-gtlayout)
  170.    (default #gui-choice)
  171.   )
  172.  )
  173.  (set #gui-choice-name (select #gui-choice "MUI" "MUIMWB" "GTLayout"))
  174. )
  175.  
  176. (procedure P-select-icon
  177.  (set #icon-choice
  178.   (askchoice
  179.    (prompt "Please select which icons you\nwant to use for Miami and\n"
  180.     "the utility programs:")
  181.    (help "Miami comes with three different\nicon styles. Please select\n"
  182.     "the one you prefer.")
  183.    (choices "do not install new icons" "standard" "Magic Workbench" "NewIcons")
  184.   )
  185.  )
  186. )
  187.  
  188. (procedure P-copy-file
  189.  (copyfiles
  190.   (source (tackon #source-dir #to-copy))
  191.   (dest @default-dest)
  192.   (optional force)
  193.  )
  194. )
  195.  
  196. (procedure P-set-tooltypes
  197.  (if (not (= #icon-choice 0)) (
  198.   (tooltype
  199.    (dest (tackon @default-dest "Miami"))
  200.    (noposition)
  201.   )
  202.   (tooltype
  203.    (dest (tackon @default-dest "MiamiInit"))
  204.    (noposition)
  205.   )
  206.   (tooltype
  207.    (dest (tackon @default-dest "MiamiRegister"))
  208.    (noposition)
  209.   )
  210.   (tooltype
  211.    (dest (tackon @default-dest "Miami.guide"))
  212.    (noposition)
  213.    (setdefaulttool #ag-browser)
  214.   )
  215.  ))
  216. )
  217.  
  218. (procedure P-add-to-startup
  219.  (if #old-miami-assign
  220.   (if (= (#old-miami-assign-location (expandpath @default-dest)))
  221.    (set #change-startup 0)
  222.    (set #change-startup 1)
  223.   )
  224.   (set #change-startup 1)
  225.  )
  226.  (if #change-startup
  227.   (
  228.    (set #startup-addition (cat
  229.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  230.     )
  231.    )
  232.    (if
  233.     (askbool
  234.      (prompt "It is NECESSARY that an assign "
  235.       "'Miami:' is created for the Miami installation "
  236.       "directory. Would you like Installer "
  237.       "to make the required change to your user-startup "
  238.       "file ? If you answer 'No' then you need to make the "
  239.       "addition yourself, manually, before you can use Miami.")
  240.      (help "It is NECESSARY that an assign "
  241.       "'Miami:' is created for the Miami installation "
  242.       "directory. Would you like Installer "
  243.       "to make the required change to your user-startup "
  244.       "file ? If you answer 'No' then you need to make the "
  245.       "addition yourself, manually, before you can use Miami. "
  246.       "You should only answer with 'No' if you prefer to edit "
  247.       "the user-startup file yourself. If you answer 'No' then "
  248.       "a file 'addition-to-user-startup' will be created in the "
  249.       "Miami installation directory instead. You need to add the "
  250.       "contents of that file to your user-startup file.")
  251.      (choices "Yes" "No")
  252.     )
  253.     (startup "Miami"
  254.      (command #startup-addition)
  255.      (prompt "Installer will modify your s:user-startup "
  256.       "script. The following lines will be added:\n\n"
  257.       #startup-addition)
  258.      (help "Installer will modify your s:user-startup "
  259.       "script. The following lines will be added:\n\n"
  260.       #startup-addition)
  261.     )
  262.     (textfile
  263.      (dest (tackon @default-dest "addition-to-user-startup"))
  264.      (append #startup-addition)
  265.     )
  266.    )
  267.   )
  268.  )
  269. )
  270.  
  271. (procedure P-set-envvars
  272.  
  273.  (set #env-equal-envarc (= (expandpath "ENV:") (expandpath "ENVARC:")))
  274.  (if (not (exists "ENV:MIAMI"))
  275.   (makedir "ENV:MIAMI")
  276.  )
  277.  (if (not #env-equal-envarc)
  278.   (if (not (exists "ENVARC:MIAMI"))
  279.    (makedir "ENVARC:MIAMI")
  280.   )
  281.  )
  282.  (textfile
  283.   (dest "ENV:MIAMI/GUI")
  284.   (append #gui-choice-name)
  285.  )
  286.  (if (not #env-equal-envarc)
  287.   (copyfiles
  288.    (source "ENV:MIAMI/GUI")
  289.    (dest "ENVARC:MIAMI")
  290.   )
  291.  )
  292. )
  293.  
  294.  
  295. (welcome "Welcome to the Miami 3.0 installation.\n")
  296.  
  297. (set app-name "Miami 3.0")
  298.  
  299. (P-check-system-version)
  300.  
  301. (if @pretend
  302.   (abort "Pretend mode cannot be used with this\n"
  303.    "installation script.")
  304. )
  305.  
  306. (complete 0)
  307.  
  308. (set #source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  309.  (expandpath @icon))
  310. )
  311.  
  312. (P-select-destination-directory)
  313.  
  314. (complete 5)
  315.  
  316. (P-select-binary)
  317.  
  318. (P-check-binary)
  319.  
  320. (complete 10)
  321.  
  322. (P-select-icon)
  323.  
  324. (complete 15)
  325.  
  326. (P-select-guis)
  327.  
  328. (P-select-gui)
  329.  
  330. (P-check-guis)
  331.  
  332. (complete 20)
  333.  
  334. ; start actual installation
  335.  
  336. ; delete obsolete files from older Miami versions
  337. (delete (tackon @default-dest "MiamiRemind.doc") (optional force))
  338. (delete (tackon @default-dest "MiamiInitSANA2") (optional force) (infos))
  339. (delete (tackon @default-dest "Miami.000") (optional force) (infos))
  340. (delete (tackon @default-dest "Miami.020") (optional force) (infos))
  341. (delete (tackon @default-dest "Miami.eval") (optional force) (infos))
  342.  
  343. (complete 25)
  344.  
  345. ; copy Miami binary selected by user
  346. (set #to-copy (select #cpu-choice "000/Miami.000" "020/Miami.020"))
  347. (copyfiles
  348.  (source (tackon #source-dir #to-copy))
  349.  (dest @default-dest)
  350.  (newname "Miami")
  351.  (optional force)
  352. )
  353.  
  354. (complete 30)
  355.  
  356. ; copy individual files
  357. (set #to-copy "main/CHANGES") (P-copy-file)
  358. (set #to-copy "main/Miami.guide") (P-copy-file)
  359. (set #to-copy "main/MiamiArp") (P-copy-file)
  360. (set #to-copy "main/MiamiFinger") (P-copy-file)
  361. (set #to-copy "main/MiamiIfConfig") (P-copy-file)
  362. (set #to-copy "main/MiamiInit") (P-copy-file)
  363. (complete 40)
  364. (set #to-copy "main/MiamiMapMBone") (P-copy-file)
  365. (set #to-copy "main/MiamiMRInfo") (P-copy-file)
  366. (set #to-copy "main/MiamiMRouteD") (P-copy-file)
  367. (set #to-copy "main/MiamiMTrace") (P-copy-file)
  368. (set #to-copy "main/MiamiNetStat") (P-copy-file)
  369. (set #to-copy "main/MiamiPing") (P-copy-file)
  370. (set #to-copy "main/MiamiRegister") (P-copy-file)
  371. (complete 50)
  372. (set #to-copy "main/MiamiRemind") (P-copy-file)
  373. (set #to-copy "main/MiamiResolve") (P-copy-file)
  374. (set #to-copy "main/MiamiRoute") (P-copy-file)
  375. (set #to-copy "main/MiamiSysCtl") (P-copy-file)
  376. (set #to-copy "main/MiamiTCPDump") (P-copy-file)
  377. (set #to-copy "main/MiamiTraceRoute") (P-copy-file)
  378.  
  379. (complete 60)
  380.  
  381. ; copy libraries
  382. (if (not (exists (tackon @default-dest "Libs")))
  383.  (makedir (tackon @default-dest "Libs"))
  384. )
  385. (copyfiles
  386.  (source (tackon #source-dir "main/Libs"))
  387.  (dest (tackon @default-dest "Libs"))
  388.  (optional force)
  389.  (all)
  390. )
  391.  
  392. (complete 70)
  393.  
  394. ; copy GUI modules
  395. (if (= 1 (BITAND #gui-options 1)) (
  396.  (copyfiles
  397.   (source (tackon #source-dir "MUI/MUI.MiamiGui"))
  398.   (dest (tackon @default-dest "Libs"))
  399.   (optional force)
  400.  )
  401.  (copyfiles
  402.   (source (tackon #source-dir "MUI/MUI.MiamiToolsGui"))
  403.   (dest (tackon @default-dest "Libs"))
  404.   (optional force)
  405.  )
  406. ))
  407.  
  408. (if (= 2 (BITAND #gui-options 2)) (
  409.  (run (cat "\"" (tackon #source-dir "MUI/spatch") "\" -oRAM:MUIMWB.MiamiGui \"-p"
  410.   (tackon #source-dir "MUI/MUIMWB.pch") "\" \"" (tackon #source-dir "MUI/MUI.MiamiGui") "\""))
  411.  (copyfiles
  412.   (source "RAM:MUIMWB.MiamiGui")
  413.   (dest (tackon @default-dest "Libs"))
  414.   (optional force)
  415.   (all)
  416.  )
  417.  (delete "RAM:MUIMWB.MiamiGui")
  418.  (copyfiles
  419.   (source (tackon #source-dir "MUI/MUI.MiamiToolsGui"))
  420.   (dest (tackon @default-dest "Libs"))
  421.   (optional force)
  422.  )
  423. ))
  424.   
  425. (if (= 4 (BITAND #gui-options 4)) (
  426.  (copyfiles
  427.   (source (tackon #source-dir "GTLayout/GTLayout.MiamiGui"))
  428.   (dest (tackon @default-dest "Libs"))
  429.   (optional force)
  430.  )
  431.  (copyfiles
  432.   (source (tackon #source-dir "GTLayout/GTLayout.MiamiToolsGui"))
  433.   (dest (tackon @default-dest "Libs"))
  434.   (optional force)
  435.  )
  436.  (copylib
  437.   (source (tackon #source-dir "GTLayout/gtlayout.library"))
  438.   (dest "LIBS:")
  439.   (prompt "The Installer is about to install gtlayout.library "
  440.   "in your LIBS: directory.")
  441.   (help "The GTLayout GUI module needs gtlayout.library for layout generation. "
  442.   "If you skip this step during the installation, you have to "
  443.   "install gtlayout.library manually somewhere within your LIBS: "
  444.   "assign.")
  445.   (confirm)
  446.  )
  447. ))
  448.  
  449. (complete 80)
  450.  
  451. ; set icons
  452.  
  453. (if (not (= #icon-choice 0)) (
  454.  (set #to-copy
  455.   (select #icon-choice
  456.    ""
  457.    "main/Icons/Standard/Miami.info"
  458.    "main/Icons/MagicWB/Miami.info"
  459.    "main/Icons/NewIcons/Miami.info"
  460.   )
  461.  )
  462.  (copyfiles
  463.   (source (tackon #source-dir #to-copy))
  464.   (dest @default-dest)
  465.  )
  466.  (copyfiles
  467.   (source (tackon #source-dir #to-copy))
  468.   (dest @default-dest)
  469.   (newname "MiamiInit.info")
  470.  )
  471.  (copyfiles
  472.   (source (tackon #source-dir #to-copy))
  473.   (dest @default-dest)
  474.   (newname "MiamiRegister.info")
  475.  )
  476.  (copyfiles
  477.   (source (tackon #source-dir #to-copy))
  478.   (dest "ENV:Sys")
  479.   (newname "def_MiamiApp.info")
  480.  )
  481.  (copyfiles
  482.   (source (tackon #source-dir #to-copy))
  483.   (dest "ENV:Sys")
  484.   (newname "def_MiamiAppOnline.info")
  485.  )
  486.  (copyfiles
  487.   (source (tackon #source-dir #to-copy))
  488.   (dest "ENVARC:Sys")
  489.   (newname "def_MiamiApp.info")
  490.  )
  491.  (copyfiles
  492.   (source (tackon #source-dir #to-copy))
  493.   (dest "ENVARC:Sys")
  494.   (newname "def_MiamiAppOnline.info")
  495.  )
  496.  (set #to-copy "main/CHANGES.info") (P-copy-file)
  497.  (set #to-copy "main/Miami.guide.info") (P-copy-file)
  498.  (if (= #icon-choice 3) (
  499.   (if (exists "ENV:Sys/def_amigaguide.info")
  500.    (copyfiles
  501.     (source "ENV:Sys/def_amigaguide.info")
  502.     (dest @default-dest)
  503.     (newname "Miami.guide.info")
  504.    )
  505.   )
  506.   (if (exists "ENV:Sys/def_ascii.info")
  507.    (copyfiles
  508.     (source "ENV:Sys/def_ascii.info")
  509.     (dest @default-dest)
  510.     (newname "CHANGES.info")
  511.    )
  512.   )
  513.  ))
  514. ))
  515.  
  516. (complete 85)
  517.  
  518. (P-set-tooltypes)
  519.  
  520. (complete 90)
  521.  
  522. (P-set-envvars)
  523.  
  524. (complete 95)
  525.  
  526. (P-add-to-startup)
  527.  
  528. (complete 100)
  529.  
  530. (exit "The installation of Miami is finished. If you are "
  531.  "upgrading from an earlier version of Miami then you need "
  532.  "to execute the Shell command `avail flush' or reboot your "
  533.  "computer before starting Miami 3.0.")
  534.